#############
#Written By : Ronny Bull (aka. Cubber)
#Quest Name: Items and levels for a Small Server.
#Quest Zone: Bazaar
#Quest NPC: Galarono_McHalorsos
#################
sub EVENT_SAY
{
   	if($text=~/Hail/i)
      		{
         	quest::say("Hello there $name! I have in my possesion some very fine items, as well as a few useful abilities that I am offering to adventurers for a small donation.  Are you [interested] in what I have to offer?");
      		}
	
	elsif ($text=~/interested/i)
		
		{
			quest::say("Tell me $race what are ya looking for? [Bags], [Pet Gear], [Spells], some [Dye] for your armour, or some very [Special Items]?  I can also help you catch up to your friends by granting you some [Levels] or [AA Points].  If you need me to I can also [refund] your AA's as well.  Or maybe you are looking to join the [Guild]?");
		}
			
				elsif ($text=~/dye/i)
					{
						quest::say("I will trade you a stack of armour dye for 25 platinum pieces.");
					}

				elsif ($text=~/bags/i)
					{
						quest::say("I will trade you a nice bag for 50 platinum pieces.");
					}
			
				elsif ($text=~/Pet Gear/i)
					{
						quest::say("I will trade you some nice gear for your pet for 100 platinum pieces.");
					}

				elsif ($text=~/Special Items/i)
					{
						quest::say("I will trade you a few very special items for 10000 platinum pieces.");
					}
			
								
				elsif ($text=~/AA Points/i)
					{
						quest::say("I will grant you 5 regular AA Points for 2500 platinum pieces.");
					}
					
	
				elsif ($text=~/Levels/i)
					{
						quest::say("I will grant you 1 level for 5000 platinum pieces.");
					}
				
				elsif ($text=~/Spells/i)
					{
						quest::say("I will grant you all of the spells up to your current level for 500 platinum pieces.");
					}
					
				elsif ($text=~/Refund/i)
					{
						quest::say("I can reset, and refund your regular AA Points for a fee of 2000 platinum pieces.");
						quest::me("Please note: this will automatically log you out of the world in order to perform the reset.");
					}
				 elsif ($text=~/Guild/i)
			                {
                        			quest::say("Ahh yes the Guild!  It is the greatest guild in all the land... All of the most revered adventures in norrath join it! Besides the many benifits that being in a guild has to offer, it also allows members to keep in touch with each other easily.");
                        			quest::say("Tell me $race, would you like to [join]?");
                			}
        			elsif ($text=~/join/i)
                			{
                        			quest::setguild(1,0);
                        			quest::say("Welcome to the guild $name!");
                			}

				
}

sub EVENT_ITEM

{

	if($platinum ==25)
		{
			quest::summonitem("32557","20");
		}

	elsif($platinum ==50)
		{
			quest::summonitem("17145");
		}

	elsif($platinum ==100)
		{
			quest::summonitem("46987");
			quest::summonitem("28595");
			quest::summonitem("28595");
			quest::summonitem("28596");
			quest::summonitem("28596");
			quest::summonitem("28598");
		}
	
	elsif($platinum ==10000)
		{
			quest::summonitem("31951");
			quest::summonitem("31883");
			quest::summonitem("31881");
			quest::summonitem("31885");
			quest::summonitem("31954");
		}

	elsif($platinum ==2500)
		{
			quest::ding();
			quest::emote("grants you 5 AA Points!");
			$client->AddAAPoints(5);
		}

	elsif($platinum ==5000)
		{
			if (quest::getlevel() >= 65)
				{
					quest::say("You are currently at the max level");
					quest::givecash(0,0,0,5000)
				}	
			else
				{
					quest::emote("grants you 1 level!");
					quest::level(quest::getlevel(0) +1);
				}
		}
			
	elsif($platinum ==500)
		{
			quest::scribespells(quest::getlevel(0));
			quest::emote("points at your spellbook");
		}

	elsif($platinum ==2000)
		{
			quest::emote("strips you of your abilities and refreshes your spirit");
			$client->RefundAA();
		}
}
